//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
//
// (C) Copyright 2006 Marvell International Ltd.
// All Rights Reserved
//

#ifndef __OV7660_H__
#define __OV7660_H__

#include "sensor.h"

class Ov7660 : public Sensor
{
public:
    Ov7660();
    bool detect();
    unsigned int get_formats(ULONG type, PCS_DATARANGE_VIDEO** formats);
    void set_power_mode(bool is_on);
    void set_frame_format(int format, FrameSize size);
    void start_capture();
    void stop_capture();
    camera_cfg_t* get_camera_cfg(PCS_VIDEOINFOHEADER pCsVideoInfoHdr, ULONG mode);
    void handle_frame_interrupt(PUCHAR buf,
                                CS_BITMAPINFOHEADER* info_header,
                                frame_t* frame);
private:
    UINT gain;
    UINT exposure;
    UCHAR pre_gain;
    UCHAR r_gain;
    UCHAR b_gain;
    FrameSize frame_size;
};


#endif